package com.app.service.userService.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.app.beans.User;
import com.app.dao.user.UserDao;
import com.app.service.userService.UserService;

@Service
@Transactional
public class UserServiceImpl implements UserService {
	private UserDao<User> userDao;
	
	@Autowired
	public void setUserDao(UserDao<User> userDao) {
		this.userDao = userDao;
	}
	
	@Override
	@Transactional(readOnly=false)
	public boolean addUser(User u) {
		return userDao.addUser(u);
	}

	@Override
	public boolean updateUser(User u) {
		return userDao.updateUser(u);
	}

	@Override
	@Transactional(readOnly=true)
	public User findUser(int id) {
		return userDao.findUser(id);
	}

}
